package sources.collection;

import java.util.Iterator;

public class TestArrayList {

    public static void main(String[] args) {
        ArrayList list = new ArrayList<>();
        list.add("123");
        list.add("456");
        list.add("789");
        Iterator it = list.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
            it.remove();
        }
    }

}
